package com.wc.alorithm_luogu.P1125;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/4/22 14:07
 * @description https://www.luogu.com.cn/problem/P1125
 * 笨小猴
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        // 存储字母出现的次数
        int[] letters = new int[128];

        String s = sc.nextLine();
        char[] chs = s.toCharArray();

        // 统计次数
        for (char ch : chs) {
            letters[ch]++;
        }

        int max = -1;
        int min = 101;
        // 找出最大值与最小值
        for (int i = 'a'; i <= 'z'; i++) {
            max = Math.max(max, letters[i]);
            if (letters[i] != 0) {
                min = Math.min(min, letters[i]);
            }
        }

        // 差值
        int sub = max - min;
        Main main = new Main();

        if (main.isPrime(sub)) {
            System.out.println("Lucky Word");
            System.out.println(sub);
        } else {
            System.out.println("No Answer");
            System.out.println(0);
        }
    }

    /**
     * 判断num是否为质数
     *
     * @param num 待查数
     */
    public boolean isPrime(int num) {
        if (num <= 1) {
            return false;
        }
        int mid = (int) Math.pow(num, 0.5);
        for (int i = 2; i <= mid; i++) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }
}
